package com.pig4cloud.pig.admin.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pig.admin.api.entity.MetaEntityEntity;
import com.pig4cloud.pig.admin.entity.Field;
import com.pig4cloud.pig.common.core.util.R;

import java.util.List;
import java.util.Map;

/**
 * @author mobai
 */
public interface CommonService extends IService<Map<String, Object>> {
	/**
	 * 生成基础实体
	 */
	void createBaseEntity(String tableName);

	/**
	 * 添加表字段
	 */
	void addTableField(String tableName, Field field);

	/**
	 * 删除表字段
	 */
	void removeTableField(String tableName, String fieldName);

	R getMetaEntityPage(Page page, Map<String, Object> params, String label);

	R getMetaFieldList(String label);

	R addTableData(String label, Map<String, Object> params);

	R getDetails(String label, String id);

	R updateEntityById(String label, Map<String, Object> params);

	R removeDataById(String label, Long[] ids);

	R startFlow(String label, String id);
}
